1. Field of the Invention.
The present invention relates to color interpolation, and, more particularly, to a method of performing color conversion to convert a set of RGB (red, green, blue) color values to color values in an output color space using fast color interpolation.
2. Description of the Related Art.
An imaging apparatus, such as an ink jet printer, typically utilizes a printer driver which converts 3-channel additive RGB data into n-channel subtractive ink colorant data. Typically, where n=4, the colorants are cyan, magenta, yellow and black. The relationship between the additive and subtractive color spaces is very nonlinear, thereby requiring a general functional conversion capability. Typically, a 3-dimensional color conversion table is employed, which is commonly implemented as a“C” programming array inside the printer driver code. The color conversion table is often depicted as a three dimensional lattice cube.
The array of the lattice cube is indexed by three 8-bit values on the range 0 to 255 that correspond to R (red), G (green), and B (blue) image information. There are n arrays, one for each ink type. A common“color table” with n=4 for cyan, magenta, yellow, and black is therefore declared as follows: unsigned char Cya[17][17][17]; unsigned char Mag[17][17][17]; unsigned char Yel[17][17][17]; and unsigned char Blk[17][17][17]. The example shows a commonly used array size, in which there are 17 samples along each of the red, green and blue axes, which by convention of the “C” programming language are indexed by values on the range 0 to 16, inclusive. The 17×17×17 size (referred to as a“17 cube”) has been found to be a good tradeoff between array size and quality of conversion. For the sake of convention, the array indices are indexed in the order [red][green][blue]. The objective of the color table is to provide information about which inks, and how much of each ink, should be used to print any specified combination of colors given in the RGB color space.
There are several known methods that may be used to perform color conversion between additive and subtractive color spaces employing the color table identified above.
One such method to select a lattice point Q from the lattice cube based on RGB input values is referred to as bit truncation. Given that RGB values are provided in 8-bit form for each of the three channels, the higher order (known as the“most significant”) 4 bits of each may be utilized to index independently each of the three channels of the conversion table. The method of bit truncation has the advantage of being fast to execute, since ignoring the four least significant bits of each of the RGB values is trivially executed by a general purpose processor. Bit truncation has a second important advantage in that colors that correspond to shades of gray (such colors have the property that R=G=B) will be taken from what is known as the “neutral axis” of the color table. However, bit truncation has the disadvantage commonly referred to as“contouring”, wherein multiple sets of RGB values will index the same location in the conversion table, i.e., the same ink data will be retrieved for multiple RGB values, even though the multiple sets of RGB values refer to different colors.
One approach used to overcome the contouring problem is known as trilinear interpolation. In trilinear interpolation, the most significant bits are used to determine a“subcube” of eight nearby lattice points in the 17 cube that correspond to the lattice point Q, plus all of the additional seven combinations of lattice points found by increasing the index by one lattice coordinate along each dimension. The least significant bits are used to provide a weight to, or average, to the nearby lattice points. Trilinear interpolation provides a sound interpolation strategy in the context of color conversion, since its use of the least significant bits of RGB reduces the problem of contouring. However, because of the complexity of the interpolation expression, trilinear interpolation is generally much slower in execution than bit truncation. Also, if a point P lies on the neutral axis, the interpolated result will unfortunately be adversely impacted by a total of eight lattice points, of which only two are tweaked to be visually neutral.
Tetrahedral interpolation was developed to overcome the neutral axis problem of trilinear interpolation. Instead of one lattice point being used to evaluate the point P (as in bit truncation) or eight lattice points (as in trilinear interpolation), only four lattice points are weighted in three dimensional tetrahedral interpolation. Although tetrahedral interpolation has the advantage of preserving the neutral axis and not exhibiting significant contouring, tetrahedral interpolation is still complicated, and thus, is generally slow to execute.